package com.zhanghaijun.createCode.util;

/**
 * Created by zhanghaijun on 15/4/29.
 */
public class TableNameConvertUtil {

    public static String convert4ClassName(String tableName) {
        String[] subs = tableName.split("_");
        String result = "";
        for (int i = 0; i < subs.length; i++) {
            result += subs[i].toUpperCase().charAt(0)+subs[i].substring(1, subs[i].length());
        }
        return result;
    }

    public static String convert4ProName(String tableName) {
        String[] subs = tableName.split("_");
        String result = subs[0];
        for (int i = 1; i < subs.length; i++) {
            result += subs[i].toUpperCase().charAt(0)+subs[i].substring(1, subs[i].length());
        }
        return result;
    }

    public static void main(String[] args) {
        System.out.println(TableNameConvertUtil.convert4ProName("ttt_sss_ggg"));
    }



}
